<?php
/*
 * Copyright (c) 2017-2025 Tencent. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
namespace TencentCloud\Emr\V20190103\Models;
use TencentCloud\Common\AbstractModel;

/**
 * InquiryPriceRenewInstance response structure.
 *
 * @method float getOriginalCost() Obtain Original price.
 * @method void setOriginalCost(float $OriginalCost) Set Original price.
 * @method float getDiscountCost() Obtain Discounted price.
 * @method void setDiscountCost(float $DiscountCost) Set Discounted price.
 * @method string getTimeUnit() Obtain Time unit for instance renewal.
 * @method void setTimeUnit(string $TimeUnit) Set Time unit for instance renewal.
 * @method integer getTimeSpan() Obtain Duration of instance renewal.
 * @method void setTimeSpan(integer $TimeSpan) Set Duration of instance renewal.
 * @method array getPriceDetail() Obtain Price details.
Note: This field may return null, indicating that no valid values can be obtained.
 * @method void setPriceDetail(array $PriceDetail) Set Price details.
Note: This field may return null, indicating that no valid values can be obtained.
 * @method array getNodeRenewPriceDetails() Obtain Node renewal pricing list.
 * @method void setNodeRenewPriceDetails(array $NodeRenewPriceDetails) Set Node renewal pricing list.
 * @method string getRequestId() Obtain The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
 * @method void setRequestId(string $RequestId) Set The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
 */
class InquiryPriceRenewInstanceResponse extends AbstractModel
{
    /**
     * @var float Original price.
     */
    public $OriginalCost;

    /**
     * @var float Discounted price.
     */
    public $DiscountCost;

    /**
     * @var string Time unit for instance renewal.
     */
    public $TimeUnit;

    /**
     * @var integer Duration of instance renewal.
     */
    public $TimeSpan;

    /**
     * @var array Price details.
Note: This field may return null, indicating that no valid values can be obtained.
     */
    public $PriceDetail;

    /**
     * @var array Node renewal pricing list.
     */
    public $NodeRenewPriceDetails;

    /**
     * @var string The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
     */
    public $RequestId;

    /**
     * @param float $OriginalCost Original price.
     * @param float $DiscountCost Discounted price.
     * @param string $TimeUnit Time unit for instance renewal.
     * @param integer $TimeSpan Duration of instance renewal.
     * @param array $PriceDetail Price details.
Note: This field may return null, indicating that no valid values can be obtained.
     * @param array $NodeRenewPriceDetails Node renewal pricing list.
     * @param string $RequestId The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
     */
    function __construct()
    {

    }

    /**
     * For internal only. DO NOT USE IT.
     */
    public function deserialize($param)
    {
        if ($param === null) {
            return;
        }
        if (array_key_exists("OriginalCost",$param) and $param["OriginalCost"] !== null) {
            $this->OriginalCost = $param["OriginalCost"];
        }

        if (array_key_exists("DiscountCost",$param) and $param["DiscountCost"] !== null) {
            $this->DiscountCost = $param["DiscountCost"];
        }

        if (array_key_exists("TimeUnit",$param) and $param["TimeUnit"] !== null) {
            $this->TimeUnit = $param["TimeUnit"];
        }

        if (array_key_exists("TimeSpan",$param) and $param["TimeSpan"] !== null) {
            $this->TimeSpan = $param["TimeSpan"];
        }

        if (array_key_exists("PriceDetail",$param) and $param["PriceDetail"] !== null) {
            $this->PriceDetail = [];
            foreach ($param["PriceDetail"] as $key => $value){
                $obj = new PriceDetail();
                $obj->deserialize($value);
                array_push($this->PriceDetail, $obj);
            }
        }

        if (array_key_exists("NodeRenewPriceDetails",$param) and $param["NodeRenewPriceDetails"] !== null) {
            $this->NodeRenewPriceDetails = [];
            foreach ($param["NodeRenewPriceDetails"] as $key => $value){
                $obj = new NodeRenewPriceDetail();
                $obj->deserialize($value);
                array_push($this->NodeRenewPriceDetails, $obj);
            }
        }

        if (array_key_exists("RequestId",$param) and $param["RequestId"] !== null) {
            $this->RequestId = $param["RequestId"];
        }
    }
}
